.class Lcom/estrongs/android/util/p;
.super Ljava/lang/Object;
.source "ESThreadPoolImpl.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/estrongs/android/util/p$a;
    }
.end annotation


# instance fields
.field private final a:Lcom/estrongs/android/util/p$a;

.field private b:J

.field private c:I

.field private d:I

.field private final e:Ljava/util/concurrent/BlockingQueue;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/BlockingQueue<",
            "Ljava/lang/Runnable;",
            ">;"
        }
    .end annotation
.end field

.field private final f:Ljava/util/concurrent/locks/ReentrantLock;

.field private g:I

.field private h:Ljava/util/concurrent/atomic/AtomicInteger;

.field private volatile i:Ljava/util/concurrent/ThreadFactory;


# direct methods
.method public constructor <init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;)V
    .locals 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(IIJ",
            "Ljava/util/concurrent/TimeUnit;",
            "Ljava/util/concurrent/BlockingQueue<",
            "Ljava/lang/Runnable;",
            ">;",
            "Ljava/util/concurrent/ThreadFactory;",
            ")V"
        }
    .end annotation

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    new-instance v0, Lcom/estrongs/android/util/p$a;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Lcom/estrongs/android/util/p$a;-><init>(Lcom/estrongs/android/util/p;Z)V

    iput-object v0, p0, Lcom/estrongs/android/util/p;->a:Lcom/estrongs/android/util/p$a;

    .line 3
    new-instance v0, Ljava/util/concurrent/locks/ReentrantLock;

    invoke-direct {v0}, Ljava/util/concurrent/locks/ReentrantLock;-><init>()V

    iput-object v0, p0, Lcom/estrongs/android/util/p;->f:Ljava/util/concurrent/locks/ReentrantLock;

    .line 4
    iput v1, p0, Lcom/estrongs/android/util/p;->g:I

    .line 5
    new-instance v0, Ljava/util/concurrent/atomic/AtomicInteger;

    invoke-direct {v0, v1}, Ljava/util/concurrent/atomic/AtomicInteger;-><init>(I)V

    iput-object v0, p0, Lcom/estrongs/android/util/p;->h:Ljava/util/concurrent/atomic/AtomicInteger;

    if-ltz p1, :cond_1

    if-lez p2, :cond_1

    if-lt p2, p1, :cond_1

    const-wide/16 v0, 0x0

    cmp-long v2, p3, v0

    if-ltz v2, :cond_1

    if-eqz p6, :cond_0

    if-eqz p7, :cond_0

    .line 6
    iput p1, p0, Lcom/estrongs/android/util/p;->c:I

    .line 7
    iput p2, p0, Lcom/estrongs/android/util/p;->d:I

    .line 8
    iput-object p6, p0, Lcom/estrongs/android/util/p;->e:Ljava/util/concurrent/BlockingQueue;

    .line 9
    invoke-virtual {p5, p3, p4}, Ljava/util/concurrent/TimeUnit;->toNanos(J)J

    move-result-wide p1

    iput-wide p1, p0, Lcom/estrongs/android/util/p;->b:J

    .line 10
    iput-object p7, p0, Lcom/estrongs/android/util/p;->i:Ljava/util/concurrent/ThreadFactory;

    return-void

    :cond_0
    const/4 p1, 0x0

    .line 11
    throw p1

    .line 12
    :cond_1
    new-instance p1, Ljava/lang/IllegalArgumentException;

    invoke-direct {p1}, Ljava/lang/IllegalArgumentException;-><init>()V

    throw p1
.end method

.method static synthetic a(Lcom/estrongs/android/util/p;)Ljava/util/concurrent/atomic/AtomicInteger;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/util/p;->h:Ljava/util/concurrent/atomic/AtomicInteger;

    return-object p0
.end method

.method static synthetic b(Lcom/estrongs/android/util/p;)J
    .locals 2

    .line 1
    iget-wide v0, p0, Lcom/estrongs/android/util/p;->b:J

    return-wide v0
.end method

.method static synthetic c(Lcom/estrongs/android/util/p;)Ljava/util/concurrent/BlockingQueue;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/util/p;->e:Ljava/util/concurrent/BlockingQueue;

    return-object p0
.end method

.method static synthetic d(Lcom/estrongs/android/util/p;)Ljava/util/concurrent/locks/ReentrantLock;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/util/p;->f:Ljava/util/concurrent/locks/ReentrantLock;

    return-object p0
.end method

.method static synthetic e(Lcom/estrongs/android/util/p;)I
    .locals 0

    .line 1
    iget p0, p0, Lcom/estrongs/android/util/p;->g:I

    return p0
.end method

.method static synthetic f(Lcom/estrongs/android/util/p;)I
    .locals 2

    .line 1
    iget v0, p0, Lcom/estrongs/android/util/p;->g:I

    add-int/lit8 v1, v0, -0x1

    iput v1, p0, Lcom/estrongs/android/util/p;->g:I

    return v0
.end method

.method static synthetic g(Lcom/estrongs/android/util/p;)I
    .locals 0

    .line 1
    iget p0, p0, Lcom/estrongs/android/util/p;->c:I

    return p0
.end method


# virtual methods
.method public a(Ljava/lang/Runnable;)V
    .locals 2
    .param p1    # Ljava/lang/Runnable;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param

    .line 2
    iget-object v0, p0, Lcom/estrongs/android/util/p;->e:Ljava/util/concurrent/BlockingQueue;

    invoke-interface {v0, p1}, Ljava/util/concurrent/BlockingQueue;->offer(Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_3

    .line 3
    iget-object p1, p0, Lcom/estrongs/android/util/p;->f:Ljava/util/concurrent/locks/ReentrantLock;

    invoke-virtual {p1}, Ljava/util/concurrent/locks/ReentrantLock;->lock()V

    .line 4
    :try_start_0
    iget-object p1, p0, Lcom/estrongs/android/util/p;->h:Ljava/util/concurrent/atomic/AtomicInteger;

    invoke-virtual {p1}, Ljava/util/concurrent/atomic/AtomicInteger;->get()I

    move-result p1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-lez p1, :cond_0

    .line 5
    iget-object p1, p0, Lcom/estrongs/android/util/p;->f:Ljava/util/concurrent/locks/ReentrantLock;

    invoke-virtual {p1}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V

    return-void

    .line 6
    :cond_0
    :try_start_1
    iget p1, p0, Lcom/estrongs/android/util/p;->g:I

    iget v0, p0, Lcom/estrongs/android/util/p;->d:I

    if-ge p1, v0, :cond_2

    .line 7
    iget p1, p0, Lcom/estrongs/android/util/p;->g:I

    iget v0, p0, Lcom/estrongs/android/util/p;->c:I

    const/4 v1, 0x1

    if-ge p1, v0, :cond_1

    .line 8
    iget-object p1, p0, Lcom/estrongs/android/util/p;->i:Ljava/util/concurrent/ThreadFactory;

    new-instance v0, Lcom/estrongs/android/util/p$a;

    invoke-direct {v0, p0, v1}, Lcom/estrongs/android/util/p$a;-><init>(Lcom/estrongs/android/util/p;Z)V

    invoke-interface {p1, v0}, Ljava/util/concurrent/ThreadFactory;->newThread(Ljava/lang/Runnable;)Ljava/lang/Thread;

    move-result-object p1

    invoke-virtual {p1}, Ljava/lang/Thread;->start()V

    goto :goto_0

    .line 9
    :cond_1
    iget-object p1, p0, Lcom/estrongs/android/util/p;->i:Ljava/util/concurrent/ThreadFactory;

    iget-object v0, p0, Lcom/estrongs/android/util/p;->a:Lcom/estrongs/android/util/p$a;

    invoke-interface {p1, v0}, Ljava/util/concurrent/ThreadFactory;->newThread(Ljava/lang/Runnable;)Ljava/lang/Thread;

    move-result-object p1

    invoke-virtual {p1}, Ljava/lang/Thread;->start()V

    .line 10
    :goto_0
    iget p1, p0, Lcom/estrongs/android/util/p;->g:I

    add-int/2addr p1, v1

    iput p1, p0, Lcom/estrongs/android/util/p;->g:I
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 11
    :cond_2
    iget-object p1, p0, Lcom/estrongs/android/util/p;->f:Ljava/util/concurrent/locks/ReentrantLock;

    invoke-virtual {p1}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V

    return-void

    :catchall_0
    move-exception p1

    iget-object v0, p0, Lcom/estrongs/android/util/p;->f:Ljava/util/concurrent/locks/ReentrantLock;

    invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V

    .line 12
    throw p1

    .line 13
    :cond_3
    new-instance p1, Ljava/util/concurrent/RejectedExecutionException;

    invoke-direct {p1}, Ljava/util/concurrent/RejectedExecutionException;-><init>()V

    throw p1
.end method
